<?php defined('_JEXEC') or die('Restricted access'); ?>
<h1 class="headlocation">Location Index</h1>
<ul class="location_index">
    <?php
    $i=0;
    foreach($this->sections as $sections){
        $cate = $this->categories[$i];

        echo '<li>';
        echo '<a href="'.JRoute::_('index.php?option=com_content&view=contentlist&section='.$sections->id,true).'">'.$sections->title.'</a>&nbsp;('.$sections->section_num.')';
        if($cate !== 'null')
        {
            echo '<ul>';
            for($u=0; $u<count($cate); $u++){
                $categories = $cate[$u];
                echo '<li>';
                echo '<a href="'.JRoute::_('index.php?option=com_content&view=contentlist&category='.$categories->id.':'.$categories->alias,true).'">'.$categories->title.'</a>&nbsp;('.$categories->category_num.')';
                echo '</li>';
            }
            echo '</ul>';
            echo '<br/>';
        }

        echo '</li>';
        $i++;
    }
    ?>
</ul>